Field of the Invention
The present invention relates to database replication and more particularly to eventual consistency in database replication.
Description of the Related Art
Database replication refers to the frequent electronic copying of data from a database in one computing system to a database in another, so that data can be accessed from multiple computing systems and geographic locations in parallel and so that data processing can continue despite outages or disasters, natural or otherwise, at individual systems and locations. In a primary-backup (or master-slave) replication scheme, a single “master” replica processes all operations against the data and propagates either the operations or the resultant data changes to the other replicas, whereas in a multi-master replication scheme any replica may process an operation and propagates the operation or the data changes to the other replicas. In a master-slave replication scheme, the replication node that plays the role of master can change over time, especially to cope with the failure of the current master and provide disaster recovery.
A replicated database management system ensures that changes, additions, and deletions performed on the data at any given location are automatically reflected in the data stored at all the other locations. It is desirable in such a system that every user always sees data that is consistent with the data seen by all the other users. However, in many cases, absolute consistency is not possible for replicated systems—particularly in view of the “CAP” or Brewer's theorem which provides that in a distributed and replicated database system, one can only have at most two of the following three characteristics: (1) consistency in which all nodes in the cluster see exactly the same data at any point in time; (2) availability in that the failure of a node does not render the database inoperative; and (3) partition tolerance in that nodes still may function when communication with other groups of nodes becomes lost.
Eventual consistency is an approach to replicated database management that provides a compromise between strong consistency and weak (no guarantees) consistency. The core of the eventual consistency concept is that although copies or replicas of the database may not be consistent with each other at a point in time, the database copies eventually become consistent should all updates cease. That is, inconsistencies are transitory—eventually all nodes will receive the latest consistent updates. Reference is made to Werner Vogels, Eventually Consistent, in ACM Queue vol. 6, no. 6 (December 2008). Thus, in the context of replicated systems, eventual consistency provides that replicated data ultimately will be consistent after a period of time has elapsed across different data replicas.